home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 722 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: stdc.demon.co.uk!clive
  2. From: clive@stdc.demon.co.uk (Clive D.W. Feather)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Restrictions on qsort compare function?
  5. Date: Wed, 10 Apr 1996 23:24:26 GMT
  6. Organization: Demon Internet Limited (personal account)
  7. Message-ID: <Dpo6Cs.CG0@stdc.demon.co.uk>
  8. References: <4kbl1l$74r@sam.inforamp.net> <829068682snz@genesis.demon.co.uk>
  9. Reply-To: cdwf@cityscape.co.uk
  10. X-NNTP-Posting-Host: stdc.demon.co.uk
  11.  
  12. In article <829068682snz@genesis.demon.co.uk>,
  13. Lawrence Kirby  <fred@genesis.demon.co.uk> wrote:
  14. >"Undefined behaviour is otherwise indicated in this International Standard
  15. > by the words ``undefined behaviour'' or by the omission of any explicit
  16. > defintion of behaviour. There is no difference in emphasis among these
  17. > three; they all describe ``behaviour that is undefined.''"
  18. >
  19. >This means that code has undefined behaviour unless you can show what the
  20. >defined behaviour is according to the standard. In all of your examples
  21. >the behaviour can vary depending on the actual implementation of qsort().
  22. >In the absense of any other limitation in the standard (such as a statement
  23. >of implementation-defined behaviour), this means the behaviour is undefined.
  24.  
  25. No, this is circular logic. A library function must be inferred to do
  26. only what its specification says, and nothing else; you can't use
  27. undescribed behaviour to deduce that a specific call to that function is
  28. undefined. Otherwise you could say "and abs() might set all long variables
  29. to 0".
  30.  
  31. -- 
  32. Clive D.W. Feather                       | If you lie to the compiler,
  33. cdwf@cityscape.co.uk   (work, preferred) | it will get its revenge.
  34. clive@stdc.demon.co.uk (home)            |   - Henry Spencer
  35.